package com.xchb.dsaa.ds.arrays;

import org.omg.CORBA.Object;

/**
 * @author XDD
 * @project DataStructureAndAlgorithm
 * @date 2021/7/12
 * @description 动态数组.
 */
public class DynamicArrays<E> implements Arrays<E>{

    private final static Integer DEFAULT_SIZE = 15;

    private E[] data;


    private DynamicArrays(){
        this(DEFAULT_SIZE);
    }

    private DynamicArrays(Integer size){
        if(size<0){
            throw new IllegalArgumentException("arrays size not less than 0");
        }
        this.data = (E[]) new Object[size];
    }


    public void add(E e) {

    }

    public void add(E e, Integer index) {

    }

    public E delete(Integer index) {
        return null;
    }

    public void update(Integer integer, E newE) {

    }

    public E query(Integer index) {
        return null;
    }

}
